<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>添加仓库</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../css/index.css">
  <style>
    .el-input .el-input__inner,
    .el-input.is-disabled .el-input__inner,
    .el-textarea .el-textarea__inner,
    .el-textarea.is-disabled .el-textarea__inner {
      color: #000;
    }
  </style>
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :model="form" ref="contract" :rules="rules" inline-message="true" style="width: 100%">
      <div class="table_titel">
        <div class="titel">添加仓库</div>
      </div>
      <el-descriptions :column="2" border size="small">
        <el-descriptions-item label="自营/第三方">
          <el-form-item prop="Warehouse_Name">
            <el-select v-model.trim="form.Applicable_Type" placeholder="请选择自营？第三方仓库" @change="handleType" filterable
              style="width: 100%">
              <el-option label="自营仓库" value="0"></el-option>
              <el-option label="第三方仓库" value="1"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item v-if="form.Applicable_Type==1" label="选择第三方仓库">
          <el-form-item prop="Parent_Warehouse_SerialNumber">
            <el-select @change="handleWarehouse" :disabled="form.Applicable_Type!=1"
              v-model.trim="form.Parent_Warehouse_SerialNumber" placeholder="请选择选择第三方仓库" filterable style="width: 100%">
              <el-option v-for="(item,index) in warehouse" :key="index" :label="item.Warehouse_Name"
                :value="item.Warehouse_SerialNumber">
                {{item.Warehouse_Name+'(所属企业:'+item.Enterprise_Name+')'}}
              </el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="仓库名称">
          <el-form-item prop="Warehouse_Name">
            <el-input :disabled="form.Applicable_Type==1" v-model.trim="form.Warehouse_Name"
              placeholder="请输入仓库名称"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="仓库类型">
          <el-form-item prop="Warehouse_Type">
            <el-select :disabled="form.Applicable_Type==1" v-model.trim="form.Warehouse_Type" placeholder="请选择仓库类型"
              filterable style="width: 100%">
              <el-option label="自用仓库" value="0"></el-option>
              <el-option label="开放仓库" value="1"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="仓库地址">
          <el-form-item prop="Warehouse_Name">
            <el-cascader :disabled="form.Applicable_Type==1" v-model="value" filterable :props="{value:'label'}"
              :options="city" style="width: 100%" @change="handleChange"></el-cascader>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="详细地址">
          <el-form-item>
            <el-input :disabled="value.length!=3||form.Applicable_Type==1" v-model.trim="address" @change="handleChange2"
              placeholder="请输入详细地址"></el-input>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <el-form-item class="form-operation">
        <el-button @click="window.history.back()">返回</el-button>
        <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
  <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../js/utils.js"></script>
  <script type="text/javascript" src="../../../js/ID_Validity.js"></script>
  <script type="text/javascript" src="./js/Edit.js"></script>
</body>

</html>